package org.eenie.qeasy;

import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;

public class PulseConfig implements Parcelable {

    public PulseConfig(int startTime, int duration, String command) {
        this.duration = duration;
        this.startTime = startTime;
        this.command = command;
    }


    public PulseConfig(float startTime, float duration, String command, int color) {
        this.duration = duration;
        this.startTime = startTime;
        this.command = command;
        this.color = color;
    }

    public float duration;
    public float startTime;
    public String command;
    public int color = Color.parseColor("#505FBB2D");


    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeFloat(this.duration);
        dest.writeFloat(this.startTime);
        dest.writeString(this.command);
        dest.writeInt(this.color);
    }

    protected PulseConfig(Parcel in) {
        this.duration = in.readFloat();
        this.startTime = in.readFloat();
        this.command = in.readString();
        this.color = in.readInt();
    }

    public static final Parcelable.Creator<PulseConfig> CREATOR = new Parcelable.Creator<PulseConfig>() {
        @Override
        public PulseConfig createFromParcel(Parcel source) {
            return new PulseConfig(source);
        }

        @Override
        public PulseConfig[] newArray(int size) {
            return new PulseConfig[size];
        }
    };
}
